/*
 * Copyright (c) 2019, Beijing Yonyou Audit Software. All rights reserved.
 *
 */
package publish;

/**
 * @author 若雨成霜
 * @date 2019-11-25
 * @description
 */
public class SubscriberImpOne<T> implements ISubscriberPublish {
    private String name;

    SubscriberImpOne(String name) {
        super();
        this.name = name;
    }

    @Override
    public void subscribe(SubscriberPublish subscriberPublish) {
        subscriberPublish.subscribe(this);
    }

    @Override
    public void unSubscribe(SubscriberPublish subscriberPublish) {
        subscriberPublish.unSubscribe(this);
    }

    @Override
    public void update(String publisher, Object message) {
        System.out.println(this.name + "收到" + publisher + "发来的消息：" + message.toString());
    }
}
